package com.alibaba.nacos.utils;

//import org.jasypt.encryption.pbe.StandardPBEStringEncryptor;

/**
 * 给bootstrap文件数据库的账号密码加密
 */
public class Jasypt {

    public static void main(String args[]) {
//        String key = "LhshSheet!@#$";//盐
//        StandardPBEStringEncryptor encryptor = new StandardPBEStringEncryptor();
//        encryptor.setAlgorithm("PBEWithMD5AndDES");//固定值
//        encryptor.setPassword(key);
//        System.err.println("加密1:"+encryptor.encrypt("root"));
//        System.err.println("加密2:"+encryptor.encrypt("root"));
//        System.err.println("解密1:"+encryptor.decrypt("B2Gh2lqSdBV697ox1VIIhcZtTrAAtz4X"));
//        System.err.println("解密2:"+encryptor.decrypt("LebQT8ty1++CaVSkz5fWsAj9Kt+DrzE9"));
//
    }
}
